From 3d7e20748b60b3f87c1c4a8515af2c5b5f41c6fb Mon Sep 17 00:00:00 2001 From: "Ian.Campbell@xensource.com" Date: Wed, 22 Feb 2006 15:17:04 +0000 Subject: [PATCH] Move lgdt_finish inline Signed-off-by: Ian Campbell --- .../arch/i386/kernel/cpu/common-xen.c | 14 +++++++++++++- linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S | 13 ------------- .../include/asm-i386/mach-xen/asm/hypervisor.h | 3 --- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/i386/kernel/cpu/common-xen.c b/linux-2.6-xen-sparse/arch/i386/kernel/cpu/common-xen.c index 1065f4160a..d33ecbceca 100644 --- a/linux-2.6-xen-sparse/arch/i386/kernel/cpu/common-xen.c +++ b/linux-2.6-xen-sparse/arch/i386/kernel/cpu/common-xen.c @@ -583,7 +583,19 @@ void __cpuinit cpu_gdt_init(struct Xgt_desc_struct *gdt_descr) } if (HYPERVISOR_set_gdt(frames, gdt_descr->size / 8)) BUG(); - lgdt_finish(); + + /* Reload all the segment registers after changing gdt. */ + asm volatile("movl %0,%%ss\n\t" + "movl %1,%%ds\n\t" + "movl %1,%%es\n\t" + "pushl %2\n\t" /* Reload CS by intersegment return. */ + "pushl $1f\n\t" + "lret\n\t" + "1:\n\t" + : /* no outputs */ + : "r"(__KERNEL_DS), + "r"(__USER_DS), + "r"(__KERNEL_CS)); } /* diff --git a/linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S b/linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S index 6d0e732edb..61db92a16d 100644 --- a/linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S +++ b/linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S @@ -77,19 +77,6 @@ L6: jmp L6 # main should never return here, but # just in case, we know what happens. -ENTRY(lgdt_finish) - movl $(__KERNEL_DS),%eax # reload all the segment registers - movw %ax,%ss # after changing gdt. - - movl $(__USER_DS),%eax # DS/ES contains default USER segment - movw %ax,%ds - movw %ax,%es - - popl %eax # reload CS by intersegment return - pushl $(__KERNEL_CS) - pushl %eax - lret - ALIGN # boot GDT descriptor (later on used by CPU#0): diff --git a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h index c72cafeb52..3ad6799f13 100644 --- a/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h +++ b/linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h @@ -61,9 +61,6 @@ void xen_cpu_idle (void); /* arch/xen/i386/kernel/hypervisor.c */ void do_hypervisor_callback(struct pt_regs *regs); -/* arch/xen/i386/kernel/head.S */ -void lgdt_finish(void); - /* arch/xen/i386/mm/hypervisor.c */ /* * NB. ptr values should be PHYSICAL, not MACHINE. 'vals' should be already -- 2.30.2